import React, { Component } from 'react'
import   Axios  from 'axios';
// import './../css/Login.css';
class Login extends Component {
    constructor() {
        super();
        this.state = {
            user: "",
            pwd: "",
        }
    }
    changeUser = (e) => {
        this.setState({
            user: e.target.value,

        })
    }
    changePwd = (e) => {
        this.setState({
            pwd: e.target.value,
        })
    }
    Login = () => {
        // console.log("用户名为:" + this.state.user + ",密码:" + this.state.pwd);
        Axios({
            method:"post",
            url:"/jobLssuesList/list",
            data:{
                username:this.state.user,
                password:this.state.pwd,
            }
        }).then(data=>  {
            console.log(data);
        })
    }
    render() {
        const { user, pwd } = this.state;
        return (
            <>
                <div>
                    <h2>家校登录</h2>
                    <p>
                        <input type="text" placeholder='用户名' value={user} onChange={this.changeUser} />
                    </p>
                    <p>
                        <input type="password" placeholder='密码' value={pwd} onChange={this.changePwd} />
                    </p>
                    <p>
                        <button onClick={this.Login}>登录</button>
                    </p>
                </div>
            </>
        )
    }
}
export default Login;